﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace AIthin.Model.Body
{
    public class Actuator
    {
        public int LengthMaximum { get; protected set; }
        public int LengthMinimum { get; protected set; }
        public int Length { get; protected set; }

        public int Position { get; set; }
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="length_max">maximum lengs for actuator</param>
        public Actuator(int length_max)
        {
            Position = 32;
            Length = 16;
            LengthMaximum = length_max - Length;
            LengthMinimum = 1;
        }

        public void Draw(Graphics g)
        {
            g.FillRectangle(Brushes.Blue, Position, 2, Length, 6);
        }
        public void links()
        {
            if (Position > LengthMinimum) Position--;
            return;
        }
        public void rechts()
        {
            if (Position < LengthMaximum) Position++;
            return;
        }
    }
}
